<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>
<!--1. 准备一个容器-->
<div id="app">
    <vm-component1></vm-component1>
</div>
<script>
    // 创建组件
    const vmComponent = Vue.extend({
        template:"<h1 @click='fun1'>分页组件:{{age}}</h1>",
        data(){
            return{
                age:10,
                name:"jack",
            }
        },
        methods:{
            fun1:function () {
                this.age++;
            },
            fun2:function () {

            }
        },
    });
    // 注册组件
    Vue.component("vm-component1",vmComponent);
    let vm = new Vue({
        el: "#app",
        data: {}
    });
</script>


</body>
</html>